import request from "./config/request_v3";


/**
 * 添加商品到购物车
 */
export const addCart = (skuId: string, skuNum: number) => {
	return request.post(`/api/cart/addToCart/${skuId}/${skuNum}`)
}
/**
 * 获取购物车列表
 */
export const getCartList = () => {
	return request.get('/api/cart/cartList');
}
/**
 * 修改商品选中状态
 * @param skuId
 * @param isChecked
 */
export const checkCart = (skuId: string, isChecked: number) => {
	return request.get(`/api/cart/checkCart/${skuId}/${isChecked}`);
}
/**
 * 删除购物车商品
 * @param skuId
 */
export const deleteCart = (skuId: string) => {
	return request.delete(`/api/cart/deleteCart/${skuId}`)
}